<?php // Do not delete these lines

	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))

		die ('Please do not load this page directly. Thanks!');



	if (!empty($post->post_password)) { // if there's a password

		if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie

			?>



			<p class="nocomments">This post is password protected. Enter the password to view comments.</p>



			<?php

			return;

		}

	}



	/* This variable is for alternating comment background */

	$oddcomment = 'class="alt comm_items" ';

?>



<!-- You can start editing here. -->



<?php if ($comments) : ?>

	<div id="comments"><?php comments_number('目前还没有人发表评论', '有<span class="cmt-num">1</span>人发表了评论', '有<span class="cmt-num">%</span>人发表了评论' );?> &nbsp;<span id='add-comment'><a href="#respond" >↓发表评论↓</a></span></div>



	<div id="commentlist">


    <ul>
	<?php wp_list_comments('callback=theme_comments'); ?>
    </ul>


	</div>



 <?php else : // this is displayed if there are no comments so far ?>



	<?php if ('open' == $post->comment_status) : ?>

		<!-- If comments are open, but there are no comments. -->



	 <?php else : // comments are closed ?>

		<!-- If comments are closed. -->

		<p class="nocomments">评论已被关闭:(</p>



	<?php endif; ?>

<?php endif; ?>





<?php if ('open' == $post->comment_status) : ?>





<div id="respond">



<div class="cancel-comment-reply">

	<small><?php cancel_comment_reply_link(); ?></small>

</div>



<?php if ( get_option('comment_registration') && !$user_ID ) : ?>

<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>

<?php else : ?>



<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" name='commentform'>



<?php if ( $user_ID ) : ?>



<p>欢迎<a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>来说两句 | <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="退出登录">退出</a></p>



<?php else : ?>



<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />

<label for="author"><small>Name <?php if ($req) echo "(必填)"; ?></small></label></p>



<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />

<label for="email"><small>Mail (不会公开) <?php if ($req) echo "(必填)"; ?></small></label></p>



<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />

<label for="url"><small>网站</small></label></p>



<?php endif; ?>



<p><strong>表情：</strong><a href='javascript:void(0);' onclick='addSmile("<(￣︶￣)>")'><(￣︶￣)></a> | <a href='javascript:void(0);' onclick='addSmile("(⊙ˍ⊙)")'>(⊙ˍ⊙)</a> | <a href='javascript:void(0);' onclick='addSmile("＞﹏＜")'>＞﹏＜</a> | <a href='javascript:void(0);' onclick='addSmile("ｂ（￣▽￣）ｄ")'>ｂ（￣▽￣）ｄ</a> | <a href='javascript:void(0);' onclick='addSmile("（─.─||）")'>（─.─||）</a> | <a href='javascript:void(0);' onclick='addSmile("(^_-)")'>(^_-)</a></p>



<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4" onkeydown="KeyDown(this)"></textarea></p>



<p><input type="submit" tabindex="5" value="发表评论" class='btn'/> <font color='#666'>[ Ctrl+Enter提交 ]</font>

<?php comment_id_fields(); ?>

</p>

<?php do_action('comment_form', $post->ID); ?>





</form>

<script>
function addSmile(str)//添加表情
{
	document.getElementById('comment').value = document.getElementById('comment').value + str;	
}
</script>
	

<script type="text/javascript">
//Ctrl+Enter提交留言
var isIE = navigator.userAgent.indexOf("MSIE")>0;
/**
* @deprecated onkeydown function
* @param{obj} object
*
*/
function KeyDown(obj)
{
obj.onkeydown = function(e)
{
    if(isIE) // window.eventIE
    {
    if(event.ctrlKey && getkeyCode(event) == 13)
    {
     document.commentform.submit();
    }
    }
    else
    {
    if(e.ctrlKey && getkeyCode(e) == 13)
    {
     document.commentform.submit();
    }
    }
}
}

/**
* @deprecated getkeyCode
* @param{e} event
* @return keynum
*
*/
function getkeyCode(e)
{
var keynum = "";
if(isIE) // window.event IE
{
    keynum = e.keyCode;
}
else // Netscape/Firefox/Opera
{
    keynum = e.which;
}
return keynum;
}


</script>

<?php endif; // If registration required and not logged in ?>



<?php endif; // if you delete this the sky will fall on your head ?>

</div>
